<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="base.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>新建项目</title>
<link href="${basePath }/styles/style.css" rel="stylesheet" type="text/css" />
<link href="${basePath }/scripts/easy_validator/css/validate.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${basePath}/scripts/jquery.js"></script>
<script type="text/javascript" src="${basePath }/scripts/easy_validator/js/easy_validator.js"></script>
<script type="text/javascript" src="${basePath }/scripts/easy_validator/js/jquery.bgiframe.min.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		$("#users").val("");
		$("#inuser").click(function(){
			$("#alluser :selected").each(function(){
				$("#users").val($("#users").val() + "," + $(this).val());				
				$("#selecteduser").append($(this));
			});		
			
			var v = $("#users").val();
			if(v.indexOf(',') == 0){
				v = v.substring(1,v.length);
			}
			$("#users").val(v);
		});	
		$("#outuser").click(function(){
			$("#selecteduser :selected").each(function(){
				$("#alluser").append($(this));
			});		
			$("#users").val("");
			var v = $("#users").val();
			if(v.indexOf(',') == 0){
				v = v.substring(1,v.length);
			}
			$("#users").val(v);
		});		
		$(".btn_submit").click(function(){
			$("#new_project").submit();
		});
	});
</script>

</head>

<body>	    
	<%@ include file="header.jsp" %>
	<%@ include file="secondary-bar.jsp" %>
	<%@ include file="sidebar.jsp" %>
	<div id="right">
    <div class="column">
    	<h3 class="tabs_involved">
        	<img src="images/task.png" />
        创建新项目
        </h3>
        <hr />
        <div class="module_content">
        	<form id="new_project" action="project!add.jspx" method="post">
        	<div class="project_title">
            	<h4 class="project_title">名称</h4>
                <input type="text" class="input_style" name="title"  tip="不能为空" reg="^.+$" />
            </div>
            <div class="alluser">
            	<h4 class="project_title">全部人员</h4>
           		<select id="alluser"  class="user_select_style" size="10" multiple="multiple">
           			<c:forEach items="${userList }" var="u">
           				<c:if test="${u.id ne 0 }">
	                		<option value="${u.id }">${u.userName }</option>
                		</c:if>
           			</c:forEach>                 
                </select> 
            </div>
            <div class="select_action">
            	<input type="button" id="inuser" value="添加" />
                <input type="button" id="outuser" value="删除" />
            </div>
             <div class="selecteduser">
            	<h4 class="project_title">项目组人员</h4>
           		<select id="selecteduser" class="user_select_style" size="10"   tip="项目组成员，不能为空" reg="^.+$" multiple="multiple">
              	</select> 
            </div>
            <input type="hidden" id="users" name="users"/>
            </form>   
            </div> 
             <div class="actions">
                <span class="new_task">
                <a class="btn_submit" href="#">创建项目</a>
                </span>                    
            </div> 
        </div>   	       
    </div>
</body>
</html>
